package com.such.kit.datastructure.graph.bean;

import java.io.Serializable;

/**
 * @作者 SUCH
 * @日期 2016-9-27 下午2:42:15
 * @描述 （图）顶点的边
 * @param <T>
 */
public class Edge<T> implements Serializable {

	private static final long serialVersionUID = 6418013601278108359L;

	/** targetVertex：目标顶点（终点） */
	private Vertex<T> targetVertex;
	/** weight：权重 */
	private double weight = 1;

	public Edge(Vertex<T> targetVertex, double weight) {
		this.targetVertex = targetVertex;
		this.weight = weight;
	}

	public Vertex<T> getTargetVertex() {
		return this.targetVertex;
	}

	public void setTargetVertex(Vertex<T> targetVertex) {
		this.targetVertex = targetVertex;
	}

	public double getWeight() {
		return this.weight;
	}

	public void setWeight(double weight) {
		this.weight = weight;
	}

}